<!doctype html>
<html>
<head>
    <title>API for class POLLS (idxCMS: Flat Files Content Management Sysytem ver. 5.0)</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="generator" content="phpAPI 6.0 (https://github.com/Greenray/phpAPI/)">
    <link href="../style.css" type="text/css" rel="stylesheet" />
</head>
<body>
    <div class="page">
        <div class="header center">
            <div class="content">
                idxCMS: Flat Files Content Management Sysytem ver. 5.0                <div class="logo_desc">Application Programming Interface</div>
            </div>
        </div>
        <div class="panel">
            <div class="content">
                <h1>Namespaces</h1>
<ul>
    <li><a href="../administration/package-summary.html">Administration</a></li>
    <li><a href="../catalogs/package-summary.html">Catalogs</a></li>
    <li><a href="../core/package-summary.html">Core</a></li>
    <li><a href="../forum/package-summary.html">Forum</a></li>
    <li><a href="../gallery/package-summary.html">Gallery</a></li>
    <li><a href="../no package/package-summary.html">No Package</a></li>
    <li><a href="../polls/package-summary.html">Polls</a></li>
    <li><a href="../posts/package-summary.html">Posts</a></li>
    <li><a href="../rss/package-summary.html">RSS</a></li>
    <li><a href="../rate/package-summary.html">Rate</a></li>
    <li><a href="../search/package-summary.html">Search</a></li>
    <li><a href="../statistics/package-summary.html">Statistics</a></li>
    <li><a href="../tagcloud/package-summary.html">Tagcloud</a></li>
    <li><a href="../template/package-summary.html">Template</a></li>
    <li><a href="../tools/package-summary.html">Tools</a></li>
    <li><a href="../user/package-summary.html">User</a></li>
</ul>
<h1>Namespace User</h1>
    <h2>Classes</h2>
    <ul>
            <li><a href="../polls/polls.html" title="Polls \ POLLS">POLLS</a></li>
        </ul>
            </div>
        </div>
        <div class="main">
            <div class="content">
                <nav class="menu_main center"><div class="menu">
            <ul>
                    <li><a href="../index.html">Overview</a></li>
                    <li><a href="../polls/package-summary.html">Namespace</a></li>
                    <li class="active">Class</li>
                    <li><a href="../polls/package-tree.html">Polls\Tree</a></li>
                    <li><a href="../deprecated.html">Deprecated</a></li>
                    <li><a href="../todo.html">Todo</a></li>
                    <li><a href="../index-all.html">Index</a></li>
                </ul>
    </div>
    <div class="small_links">
        <a href="#details_fields">Fields</a> | <a href="#details_methods">Methods</a> | <a href="#details_constructor">Constructor</a>
    </div>
</nav>
                <hr />
<div class="package">Namespace Polls</div>
<h1>Class POLLS</h1>
<div id="list">
    <ul>
        <li><strong>POLLS</strong></li></ul></li>    </ul>
</div>
<hr />
<p class="arguments">public  class <strong>POLLS</strong></p>
<div class="comment" id="overview_description">Polls and polls archives.</div>
<div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Program</td>
            <td class="hid right w_100 lilac">&nbsp;</td>
                            <td class="hid" colspan="2">idxCMS: Flat Files Content Management System</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Version</td>
            <td class="hid right w_100 lilac">&nbsp;</td>
                            <td class="hid" colspan="2">5.0</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Author</td>
            <td class="hid right w_100 lilac">&nbsp;</td>
                            <td class="hid" colspan="2">Victor Nabatov &lt;greenray.spb@gmail.com&gt;</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Copyright</td>
            <td class="hid right w_100 lilac">&nbsp;</td>
                            <td class="hid" colspan="2">(c) 2011-2016 Victor Nabatov</td>
                    </tr>
            <tr>
            <td class="hid left w_100">License</td>
            <td class="hid right w_100 lilac">&nbsp;</td>
                            <td class="hid" colspan="2">Creative Commons Attribution-ShareAlike 4.0 International</td>
                    </tr>
            <tr>
            <td class="hid left w_100">File</td>
            <td class="hid right w_100 lilac">&nbsp;</td>
                            <td class="hid" colspan="2">system/polls.class.php</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Overview</td>
            <td class="hid right w_100 lilac">&nbsp;</td>
                            <td class="hid" colspan="2">Polls and polls archives.</td>
                    </tr>
        </table>
</div>
    <h2 id="details_fields">Fields</h2>
            <div class="location">system/polls.class.php at line 24</div>
        <pre class="arguments" id="_cookie">private  string <strong><span class="green">$_cookie</span></strong> = <span class="red">""</span></pre>
        <div class="details">User cookie</div>
        <hr />
            <div class="location">system/polls.class.php at line 18</div>
        <pre class="arguments" id="active">public  array <strong><span class="green">$active</span></strong> = []</pre>
        <div class="details">Current active poll</div>
        <hr />
            <div class="location">system/polls.class.php at line 21</div>
        <pre class="arguments" id="old">public  array <strong><span class="green">$old</span></strong> = []</pre>
        <div class="details">Old active poll</div>
        <hr />
        <h2 id="details_constructor">Constructor</h2>
    <div class="location">system/polls.class.php at line 27</div>
    <code class="arguments" id="construct">public  void <strong>construct</strong>()</code>
    <div class="details">
            <p class="description">Class constructor</p>
            </div>
    <h2 id="details_methods">Methods</h2>
            <div class="location">system/polls.class.php at line 36</div>
        <code class="arguments" id="getActivePolls">public  array <strong>getActivePolls</strong> ()</code>
        <div class="details">
                    <p class="description">Returns data of all active polls.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">array</td>
                            <td class="hid" colspan="2">Active polls data</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/polls.class.php at line 46</div>
        <code class="arguments" id="getArchivedPolls">public  array <strong>getArchivedPolls</strong> ()</code>
        <div class="details">
                    <p class="description">Returns data of all archived polls.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">array</td>
                            <td class="hid" colspan="2">Data of archived polls</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/polls.class.php at line 57</div>
        <code class="arguments" id="getPolls">private  array <strong>getPolls</strong> (<span class="lilac">array</span> <span class="blue">$polls</span>)</code>
        <div class="details">
                    <p class="description">Counts voices for each answer in poll.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">array</td>
                            <td class="hid blue w_100">$polls</td>
                <td class="hid">Polls data</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">array</td>
                            <td class="hid" colspan="2">Data of archived polls</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/polls.class.php at line 85</div>
        <code class="arguments" id="startPoll">public  boolean <strong>startPoll</strong> (<span class="lilac">string</span> <span class="blue">$id</span>, <span class="lilac">mixed</span> <span class="blue">$question</span>, <span class="lilac">mixed</span> <span class="blue">$answers</span>)</code>
        <div class="details">
                    <p class="description">Starts active poll.<br /> Assigns a random number as poll ID.<br /> This ID will be used in a user cookie after voiting.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$id</td>
                <td class="hid">Poll ID</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">boolean</td>
                            <td class="hid" colspan="2">The result of operation</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/polls.class.php at line 108</div>
        <code class="arguments" id="stopPoll">public  boolean <strong>stopPoll</strong> (<span class="lilac">string</span> <span class="blue">$id</span>)</code>
        <div class="details">
                    <p class="description">Stops active poll.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$id</td>
                <td class="hid">Poll ID</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">boolean</td>
                            <td class="hid" colspan="2">The result of operation</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/polls.class.php at line 120</div>
        <code class="arguments" id="removePoll">public  boolean <strong>removePoll</strong> (<span class="lilac">string</span> <span class="blue">$id</span>)</code>
        <div class="details">
                    <p class="description">Removes active poll.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$id</td>
                <td class="hid">Poll ID</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">boolean</td>
                            <td class="hid" colspan="2">The result of operation</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/polls.class.php at line 137</div>
        <code class="arguments" id="removePollFromArchive">public  boolean <strong>removePollFromArchive</strong> (<span class="lilac">string</span> <span class="blue">$id</span>)</code>
        <div class="details">
                    <p class="description">Removes poll from the archive.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$id</td>
                <td class="hid">Poll ID</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">boolean</td>
                            <td class="hid" colspan="2">The result of operation</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/polls.class.php at line 158</div>
        <code class="arguments" id="voteInPoll">public  boolean <strong>voteInPoll</strong> (<span class="lilac">string</span> <span class="blue">$poll</span>, <span class="lilac">integer</span> <span class="blue">$answer</span>)</code>
        <div class="details">
                    <p class="description">Voiting.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Throws</td>
            <td class="hid right w_100 lilac">Exception</td>
                            <td class="hid blue w_100">$poll</td>
                <td class="hid"><span class="red">"Invalid ID"</span></td>
                    </tr>
            <tr>
            <td class="hid left w_100">&nbsp</td>
            <td class="hid right w_100 lilac">Exception</td>
                            <td class="hid blue w_100">$answer</td>
                <td class="hid"><span class="red">"This answer does not exists in this poll"</span></td>
                    </tr>
            <tr>
            <td class="hid left w_100">&nbsp</td>
            <td class="hid right w_100 lilac">Exception</td>
                            <td class="hid" colspan="2"><span class="red">"You already voted in this poll"</span></td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">boolean</td>
                            <td class="hid" colspan="2">The result of operation</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/polls.class.php at line 180</div>
        <code class="arguments" id="isVotedInPoll">public  boolean <strong>isVotedInPoll</strong> (<span class="lilac">string</span> <span class="blue">$poll</span>)</code>
        <div class="details">
                    <p class="description">Checks already voted user.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">string</td>
                            <td class="hid blue w_100">$poll</td>
                <td class="hid">Poll ID</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">boolean</td>
                            <td class="hid" colspan="2">The result of operation</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/polls.class.php at line 196</div>
        <code class="arguments" id="showPolls">public  array <strong>showPolls</strong> (<span class="lilac">array</span> <span class="blue">$polls</span>)</code>
        <div class="details">
                    <p class="description">Shows active polls.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">array</td>
                            <td class="hid blue w_100">$polls</td>
                <td class="hid">Polls data</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">array</td>
                            <td class="hid" colspan="2">Formatted polls data</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
            <div class="location">system/polls.class.php at line 226</div>
        <code class="arguments" id="savePolls">private  boolean <strong>savePolls</strong> (<span class="lilac">boolean</span> <span class="blue">$active</span>, <span class="lilac">boolean</span> <span class="blue">$old</span>)</code>
        <div class="details">
                    <p class="description">Saves poll.</p>
            <div class="finfo">
    <table class="hid">
            <tr>
            <td class="hid left w_100">Parameters</td>
            <td class="hid right w_100 lilac">boolean</td>
                            <td class="hid blue w_100">$active</td>
                <td class="hid">Active poll</td>
                    </tr>
            <tr>
            <td class="hid left w_100">&nbsp</td>
            <td class="hid right w_100 lilac">boolean</td>
                            <td class="hid blue w_100">$old</td>
                <td class="hid">Old poll</td>
                    </tr>
            <tr>
            <td class="hid left w_100">Return</td>
            <td class="hid right w_100 lilac">boolean</td>
                            <td class="hid" colspan="2">The result of operation</td>
                    </tr>
        </table>
</div>
        </div>
        <hr />
                    <nav class="menu_main center"><div class="menu">
            <ul>
                    <li><a href="../index.html">Overview</a></li>
                    <li><a href="../polls/package-summary.html">Namespace</a></li>
                    <li class="active">Class</li>
                    <li><a href="../polls/package-tree.html">Polls\Tree</a></li>
                    <li><a href="../deprecated.html">Deprecated</a></li>
                    <li><a href="../todo.html">Todo</a></li>
                    <li><a href="../index-all.html">Index</a></li>
                </ul>
    </div>
    <div class="small_links">
        <a href="#details_fields">Fields</a> | <a href="#details_methods">Methods</a> | <a href="#details_constructor">Constructor</a>
    </div>
</nav>
            </div>
        </div>
    </div>
    <div class="footer">
        <div class="content">
            <div class="copyright center">Generated by <a href="https://github.com/Greenray/phpAPI" target="_blank">phpAPI</a>: PHP Documentation Creator ver. 6.0 &copy; 2015 - 2016 Greenray</div>
        </div>
    </div>
</body>
</html>
